<?php
/**
 * @author @author Samrat Khan & Sadik Sarfaraz - Apr 11, 2013
 */
    require('top.inc.php');
?>

<?php
if(isset($_SESSION['user']) && $_SESSION['user']['utype'] == 1) {
    $rows = selectAllBug(DESC, "reportid", "bugreport", $db);
    echo "<h5>Bug Reports</h5>";
    echo "<table id=\"bugTable\" class=\"row-fluid table table-striped table-bordered\">";
            echo "<tr>";
                echo "<th>";
                    echo "&nbsp;";
                echo "</th>";
                echo "<th>";
                    echo $bugreport['title'];
                echo "</th>";
                echo "<th>";
                    echo $bugreport['description'];
                echo "</th>";
                echo "<th>";
                    echo $bugreport['userid'];
                echo "</th>";
                echo "<th>";
                    echo $bugreport['inserteddate'];
                echo "</th>";
            echo "</tr>";
            
        foreach ($rows as $row) {
            echo "<tr>";
                echo "<td>";
                    echo "<a href='javascript:void(0)' onclick='okayBoss($row[reportid])'><i class='icon-ok'></i></a>";
                echo "</td>";
                echo "<td>";
                    echo $row['title'];
                echo "</td>";
                echo "<td>";
                    echo nl2br($row['description']);
                echo "</td>";
                echo "<td>";
                    echo getName('wms_users', 'username', 'id', $row['userid'], $db);
                echo "</td>";
                echo "<td>";
                    echo $row['inserteddate'];
                echo "</td>";
            echo "</tr>";
        }
    echo "<table>";
} else {
    header("Location: login.php");
}
?>

<?php
    include ('bottom.inc.php');
?>